<div class="fm-content">
  <!-- 最上面标题栏 -->
  <div class="title">
    <i nz-icon [type]="'desktop'"></i>
    &nbsp;&nbsp;发送信息
  </div>
  <!-- 内容 -->
  <div class="work">

    <!-- 查询框 -->
    <div class="top">
      <input nz-input placeholder="标题" class="fm-input first-input" [(ngModel)]="fs.queryObject['title:like']" />
      <input nz-input placeholder="收件人" class="fm-input" [(ngModel)]="fs.queryObject['tomail:like']" />
      <input nz-input placeholder="类型" class="fm-input" [(ngModel)]="fs.queryObject['noticetype:like']" />
      <span style="margin-left: 5px;margin-top: 5px;">
        <nz-radio-group [(ngModel)]="issend" style="width: 200px;">
          <label nz-radio nzValue="true">成功</label>
          <label nz-radio nzValue="false">失败</label>
        </nz-radio-group>
      </span>
      <nz-button-group>
        <button nz-button nzType="primary" (click)="iniFsData()">查询</button>
        <button nz-button (click)="resetFs()">重置</button>
      </nz-button-group>
    </div>

    <!-- 右则样表单主体 -->
    <div class="work-content">
      <div class="table">
        <nz-table nzSize="middle" nzShowSizeChanger [nzPageSizeOptions]='[ 10, 15, 20, 30, 40, 50 ]'
          [nzFrontPagination]="false" [nzData]="fs.datas" [nzLoading]="fs.isLoading || fs.isDeleing"
          [nzTotal]="fs.rowsCount" [(nzPageIndex)]="fs.pageIndex" [(nzPageSize)]="fs.pageSize"
          (nzPageIndexChange)="fs.loadData()" (nzPageSizeChange)="fs.loadData(true)">
          <thead>
            <tr>
              <th nzWidth="20%">标题</th>
              <th nzWidth="20%">收件人</th>
              <th nzWidth="20%">类型</th>
              <th nzWidth="20%">是否成功</th>
            </tr>
          </thead>
          <tbody>
            <tr *ngFor="let data of fs.datas">
              <td><span (click)="fs.editRow(data)" class="form-edit">
                  {{data.title}}<br />{{data.accepttime | date:'yyyy-MM-dd HH:mm:ss' }}
                </span></td>
              <td>{{data.tomail}}</td>
              <td>{{data.noticetype}}</td>
              <td>
                <span (click)="open(data.id)" class="form-edit">{{data.issend}}</span>
              </td>
            </tr>
          </tbody>
        </nz-table>
      </div>
    </div>

    <nz-modal nzWidth='830' nzTitle="详情查看" [nzMaskClosable]='false' [nzFooter]="null" [(nzVisible)]="fs.isEditVisible"
      (nzOnCancel)="fs.closeEdit()">
      <form nz-form [nzLayout]="'inline'">
        <div nz-row [nzGutter]="24">
          <div nz-col [nzSpan]="24">
            <nz-form-item>
              <nz-form-label class="form-label">标题</nz-form-label>
              <nz-form-control class="form-control3">
                {{fs.er.title}}
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>
        <div nz-row [nzGutter]="24">
          <div nz-col [nzSpan]="24">
            <nz-form-item>
              <nz-form-label class="form-label">正文</nz-form-label>
              <nz-form-control class="form-control3">
                {{fs.er.content}}
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>
        <div nz-row [nzGutter]="24">
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label class="form-label">收件人</nz-form-label>
              <nz-form-control class="form-control">
                {{fs.er.tomail}}
              </nz-form-control>
            </nz-form-item>
          </div>
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label class="form-label">接收时间</nz-form-label>
              <nz-form-control class="form-control">
                {{fs.er.accepttime | date:'yyyy-MM-dd HH:mm:ss'}}
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>
        <div nz-row [nzGutter]="24">
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label class="form-label">密送人</nz-form-label>
              <nz-form-control class="form-control">
                {{fs.er.bccmail}}
              </nz-form-control>
            </nz-form-item>
          </div>
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label class="form-label">抄送人</nz-form-label>
              <nz-form-control class="form-control">
                {{fs.er.ccmail}}
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>
        <div nz-row [nzGutter]="24">
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label class="form-label">类型</nz-form-label>
              <nz-form-control class="form-control">
                {{fs.er.noticetype}}
              </nz-form-control>
            </nz-form-item>
          </div>
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label class="form-label">是否成功</nz-form-label>
              <nz-form-control class="form-control">
                {{fs.er.issend}}
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>

        <div nz-row [nzGutter]="24">
          <div nz-col [nzSpan]="24" class="form-button-align">
            <button nz-button nzType="default" (click)="fs.closeEdit()" class="form-button">关闭</button>
          </div>
        </div>
      </form>
    </nz-modal>

    <!-- 发送日志 -->
    <nz-drawer [nzBodyStyle]="{ height: 'calc(100% - 55px)', overflow: 'auto', 'padding-bottom': '53px' }"
      [nzMaskClosable]="false" [nzWidth]="920" [nzVisible]="visible" nzTitle="发送日志" (nzOnClose)="close()">
      <div class="bpm-tabs">
        <h2 class="bpm-tabs-title">发送日志</h2>
        <nz-table nzSize="middle" nzShowSizeChanger [nzPageSizeOptions]='[ 10, 15, 20, 30, 40, 50 ]'
          [nzFrontPagination]="false" [nzData]="logfs.datas" [nzLoading]="logfs.isLoading || logfs.isDeleing"
          [nzTotal]="logfs.rowsCount" [(nzPageIndex)]="logfs.pageIndex" [(nzPageSize)]="logfs.pageSize"
          (nzPageIndexChange)="logfs.loadData()" (nzPageSizeChange)="logfs.loadData(true)">
          <thead (nzSortChange)="logfs.sort($event)" nzSingleSort>
            <tr>
              <th nzWidth="20%">发送方式</th>
              <th nzWidth="20%">发送时间</th>
              <th nzWidth="20%">发送结果</th>
              <th nzWidth="20%">失败原因</th>
            </tr>
          </thead>
          <tbody>
            <tr *ngFor="let data of logfs.datas">
              <td>{{data.type}}</td>
              <td>{{data.sendtime | date:'yyyy-MM-dd HH:mm:ss' }}</td>
              <td>{{data.result}}</td>
              <td>{{data.error}}</td>
            </tr>
          </tbody>
        </nz-table>
      </div>
    </nz-drawer>
  </div>
</div>
